/**
 * 
 */
package net.dfrz.iodemo.filework;

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;

/**
 * @author ctd
 *
 */
public class TextFileCopyWork {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		BufferedReader reader=null;
		PrintWriter    writer=null;
		
		try {
			
			reader=new BufferedReader(new InputStreamReader(new FileInputStream("c:/license.txt")));
			writer=new PrintWriter(new FileOutputStream("d:/license.txt"));
			
			String entry=null;
			
			while((entry=reader.readLine())!=null){
			  writer.println(entry);	
			}
			
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} finally{
			writer.close();
			try {
				reader.close();
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}

	}

}
